package com.xcjh.opencv.emuns;

import java.util.Objects;

/**
 * 匹配的图片
 */
public enum MatchImage {

    /**
     * debug
     */
    调试("debug.bmp", "debug"),
    /**
     * 禁用
     */
    IDEA("idea.bmp", "禁用"),
    /**
     * 查找
     */
    查找("find.bmp", "查找"),
    /**
     * 对缘-暂时不去
     */
    暂时不去("zsbq.bmp", "暂时不去"),
    对缘下一个("next.bmp", "对缘下一个"),

    /**
     * 对缘-打招呼
     */
    打招呼("dazhaohu.bmp", "打招呼"),
    粘贴("zantie.bmp", "粘贴"),
    发送("fasong.bmp", "发送"),
    有缘打招呼("hi.bmp", "有缘打招呼"),
    有缘交换微信("jianhwx.bmp", "有缘交换微信"),
    有缘现在交换("changenow.bmp", "有缘现在交换"),
    有缘私信("si.bmp", "有缘私信"),
    有缘我知道("wozd.bmp", "有缘我知道"),
    /**
     * 伊对
     */
    伊对打招呼("yiduidazhaohu.bmp", "伊对打招呼"),
    伊对发消息("ydfxx.bmp", "伊对发消息"),
    伊对不去了("buqule.bmp", "伊对不去了"),
    /**
     * 牵手
     */
    牵手喜欢("qiansxh.bmp", "牵手喜欢"),
    牵手不喜欢("qiansbxh.bmp", "牵手不喜欢"),

    ;

    private String code;
    private String message;

    private MatchImage(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static MatchImage findByKey(String key) {

        MatchImage result = null;

        for (MatchImage s : values()) {
            if (Objects.equals(s.getCode(), key)) {
                result = s;
                break;
            }
        }

        return result;
    }

    public static MatchImage findByMsg(String msg) {

        MatchImage result = null;

        for (MatchImage s : values()) {
            if (s.getMessage().equals(msg)) {
                result = s;
                break;
            }
        }

        return result;
    }
}